package com.xt.LibaryDeskManager.service.impl;

import com.xt.LibaryDeskManager.dao.TeacherMapper;
import com.xt.LibaryDeskManager.dto.TeacherDto;
import com.xt.LibaryDeskManager.dto.UpdateSeatTeacher;
import com.xt.LibaryDeskManager.dto.UserMessage;
import com.xt.LibaryDeskManager.service.TeacherService;
import com.xt.LibaryDeskManager.vo.LoginVo;
import com.xt.LibaryDeskManager.vo.TeacherVo;
import com.xt.LibaryDeskManager.vo.UpdateVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 童归权
 * @version 1.0 2021/1/31
 */
@Service
public class TeacherServiceImpl implements TeacherService {
    @Autowired
    private TeacherMapper teacherMapper;
    @Override
    public UserMessage selectByLoginVo(LoginVo loginVo) throws Exception {
        return teacherMapper.selectByLoginVo(loginVo);
    }

    @Override
    public int updateTeacher(UpdateVo updateVo) throws Exception {
        return teacherMapper.updateTeacher(updateVo);
    }

    @Override
    public int getCount() throws Exception {
        return teacherMapper.getCount();
    }

    @Override
    public List<UpdateSeatTeacher> getTeacherNoName() throws Exception {
        return teacherMapper.getTeacherNoName();
    }

    @Override
    public List<TeacherDto> getAllTeacher() throws Exception {
        return teacherMapper.getAllTeacher();
    }

    @Override
    public int updateTeacher(TeacherVo teacherVo) throws Exception {
        return teacherMapper.updateTeacher1(teacherVo);
    }

    @Override
    public int deleteTeacher(int teacherNo) throws Exception {
        return teacherMapper.deleteTeacher(teacherNo);
    }

    @Override
    public int addTeacher(TeacherVo teacherVo) throws Exception {
        return teacherMapper.addTeacher(teacherVo);
    }
}
